SpatialFear.SFCommunication

Spatial Fear
Class: SFCommunication
Description: Configures a communictation, that is played back at a SFPlayer.
The communication is configured by writing the text to display
in one of the CommunicationProtocol strings.
Because there is a limit of about 1200 characters in a string
you have to make sure each string does not get longer than 1200.
In any case you can branch to one of the other strings in the array
And continue the communication.
A communicationis done by writing down the communication text and
inserting some special tags in the text.
See the complete list of supported tags:
\\n - Place a plain \\n (without any brackets) inside your text, to do a newline.
- halts the communication for of seconds
- clears the dialog screen
Shows an actor tip on the HUD using number to index into the TippNames array to find the name of the actor to show the tip for. TippString is the string to display above the actor.
- hides the currently visible actor tip
- branches into a new communication, inside the communication string array (CommunicationProtocol[number])
- fires an event, using the name configured in Events[number]
- plays the sound with the name: resourcename
- Sets the tickrate of the running text value to floatVal, using -1 resets the tickrate to the saved tickrate before the last change.
- Plays the animation with name Animations[number] on the captains head.
- Plays the animation with name Animations[number] on the captains head using the passed tweenfactor to tween from the current animation to the new one.
- Loops the animation with name Animations[number] on the captains head.
- Loops the animation with name Animations[number] on the captains head. The specified tween factor is used to tween from the current animation to the new one.
- Displays a selection box asking for YES or NO. A yes selection branches to branch: number1 and a no selection to branch number2. Unsing -1 as a branch number will continue in the current branch.
- Opens the weapon description dialog on the HUD, using the data from the current weapon. If number = 1 the dialog is show, if number = 0 the dialog is hidden again. Used to introduce the weapon dialog. You should not forget to hide the window again. This will corrupt the rest of the HUD code. This function also enables the weapon descripton for the visor.
- Pauses the communication until this actor receives the event with the name: Events[number]. Make sure the event is fired sometime. There is no timeout.
- 'Hack'!! This messages shows all the text of the current branch IMMEDIATELY in the window! No running/ticking sound. So make sure you have no other markers like , ... in it, because the text is not interpreted and no markers are removed. Also make sure that the branch fits.
on one screen, CLS makes no sense for an instantShow message. With floatVal you specify, how long the message will be show, before processing goes on. With the number you specify the branch that is executed next (since the no tag will be evaluated in an instant show message.
- Changes the animation rate for all subsequent playanim and loopanim calls. The default setting for playback/looping is 1.0 and should be modified with this macro.
- Add an inventory item to the players inventory. classname must be the fully qualified name of an item. E.g. SFItem.SFKeyCardB.

Communication samples
CommunicationProtocol(0)="Hi guys, this is a communication sample.\\nFirst let's wait for 3 seconds.\\nNow let's clear the screen.Now we are showing an actor tip.\\nJust to make sure you know it.\\nOK let's hide it again"
CommunicationProtocol(1)="Now let's go on to some events.\\nFirst we will make some lightOk maybe we want some more light\\nThat's all regarding events for the moment."
CommunicationProtocol(2)="Let's move on to some sound.\\nStarting the sound test now!Some text in between ;)\\nThat's all for sounds."
CommunicationProtocol(3)="Let's change the tickrate a bit.\\nThis is VERY slow.\\nThis back to normal and now make it fast.OOOOOOOOOOOOOOhhhhhhhhhhhhhh veeeeeeeeeeeeeeeeeeery faaaaaaaaaaast.Uff. Back to normal speed."
CommunicationProtocol(4)="Let's do some animations.\\nLook closely at the model we are playing tree animations with a little wait in between.Now we are playing a looping animation.\\nAnd that's it."
CommunicationProtocol(5)="Now we are trying to the test some stuff\\nWe want to have an\\nautomatic CLS when the end of the screen is reached.\\nline1\\nline2\\nline3\\nline4\\nline5\\nline6\\nline7\\nline8\\nok, was that enough??\\n or maybe some more\\n??Now we are trying to the test some stuff\\nWe want to have an\\nautomatic CLS when the end of the screen is reached, so\\nlet's add some lines, to fill the screen.\\nline1\\nline2\\nline3\\nline4\\nok, was that enough??\\n or maybe some more\\n??"
CommunicationProtocol(6)="A special feature is to enable HUD upgrade modules.\\nPreviously you should not be able to get a weapon description when picking up one.\\nNow we will enable this feature.When you go on, try it and pick up a weapon.\\nBTW: The appearing dialog can be canceled with you CancelCommunication key."
CommunicationProtocol(7)="A special feature is to show the weapon descripton window for the currently held weapon.Now you can start and explain the components and benefits of this visor upgrade.Afterwards you should hide the window, to not mock up the HUD code!!!That's it for this feature."
CommunicationProtocol(8)="Now we are trying to use a Yes/No selection.So let's ask a question:\\nDo you want YES or NO ??You have decided not to branch away."
CommunicationProtocol(9)="You selected YES."
CommunicationProtocol(10)="You selected No."
CommunicationProtocol(11)="Now we want to wait for an event.Hit the trigger next to the SmartVest, to continue.Ok, you did it. Congratulations!!"
CommunicationProtocol(12)="This is an instant show message.\\nNo running text and a wait for 5 secons at the end.>"
CommunicationProtocol(13)="This is the end, sorry guys."

Author: Markus Nuebel

Extends:
Modifiers:
Source code

SpatialFear.SFCommunication
%%

Variables

%function_comment%
nameAnimations[15]
%function_comment%
boolbAddToConversationHistory
%function_comment%
boolbCanBeCanceled
%function_comment%
boolbHidePlayerHUD
%function_comment%
boolbPlayOnlyOnce
%function_comment%
stringCommunicationProtocol[25]
%function_comment%
ECommTypeCommunicationType
%function_comment%
stringDetailText[25]
%function_comment%
nameEvents[25]
%function_comment%
EFontSizeFontSize
%function_comment%
boolm_bIsTrainer
%function_comment%
boolm_bPaused
%function_comment%
boolm_bProcessed
%function_comment%
Actorm_oEventActor
%function_comment%
Pawnm_oEventInstigator
%function_comment%
nameTipNames[15]
%function_comment%
stringTitle
%function_comment%
ECommTypeType

Enums

%function_comment%
ECommTypeCT_Captain,
CT_DataNode,
CT_Trainer,
CT_NPC,

Functions

markAsCompleted ()
PostBeginPlay ()
Trigger (Actor Other, Pawn EventInstigator)

Default properties

{
     Title="Unnamed"
     bAddToConversationHistory=True
     CommunicationProtocol(0)="Hi guys, this is a communication sample.\nFirst let's wait for 3 seconds.\nNow let's clear the screen.Now we are showing an actor tip.\nJust to make sure you know it.\nOK let's hide it again"
     CommunicationProtocol(1)="Now let's go on to some events.\nFirst we will make some lightOk maybe we want some more light\nThat's all regarding events for the moment."
     CommunicationProtocol(2)="Let's move on to some sound.\nStarting the sound test now!Some text in between ;)\nThat's all for sounds."
     CommunicationProtocol(3)="Let's change the tickrate a bit.\nThis is VERY slow.\nThis back to normal and now make it fast.OOOOOOOOOOOOOOhhhhhhhhhhhhhh veeeeeeeeeeeeeeeeeeery faaaaaaaaaaast.Uff. Back to normal speed."
     CommunicationProtocol(4)="Let's do some animations.\nLook closely at the model we are playing three animations with a little wait in between.Now we are playing a looping animation.\nAnd that's it."
     CommunicationProtocol(5)="Now we are trying to the test some stuff\nWe want to have an\nautomatic CLS when the end of the screen is reached.\nline1\nline2\nline3\nline4\nline5\nline6\nline7\nline8\nline9\nok, was that enough??\n or maybe some more\n??Now we are trying to the test some stuff\nWe want to have an\nautomatic CLS when the end of the screen is reached, so\nlet's add some lines, to fill the screen.\nline1\nline2\nline3\nline4\nline5\nok, was that enough??\n or maybe some more\n??"
     CommunicationProtocol(6)="A special feature is to enable HUD upgrade modules.\nPreviously you should not be able to get a weapon description when picking up one.\nNow we will enable this feature.When you go on, try it and pick up a weapon.\nBTW: The appearing dialog can be canceled with you CancelCommunication key."
     CommunicationProtocol(7)="A special feature is to show the weapon descripton window for the currently held weapon.Now you can start and explain the components and benefits of this visor upgrade.Afterwards you should hide the window, to not mock up the HUD code!!!That's it for this feature."
     CommunicationProtocol(8)="Now we are trying to use a Yes/No selection.So let's ask a question:\nDo you want YES or NO ??You have decided not to branch away."
     CommunicationProtocol(9)="You selected YES."
     CommunicationProtocol(10)="You selected No."
     CommunicationProtocol(11)="Now we want to wait for an event.Hit the trigger next to the SmartVest, to continue.Ok, you did it. Congratulations!!"
     CommunicationProtocol(12)="This is an instant show message.\nNo running text and a wait for 5 secons at the end."
     CommunicationProtocol(13)="This is the end, sorry guys."
     Events(0)=LightFire
     Events(1)=LightFire2
     Events(2)=Continue
     Animations(0)=Basic
     Animations(1)=bLink
     Animations(2)=Smile
     Animations(3)=Angry
     Animations(4)=MouthA
     Animations(5)=MouthE
     Animations(6)=MouthM
     Animations(7)=MouthO
     Animations(8)=MouthC
     Animations(9)=MouthF
     Animations(10)=MouthU
     Animations(11)=Smirk
     Animations(12)=Worried
     Animations(13)=All
     TipNames(0)=SFSmartVest1
     FontSize=FS_Medium
     bPlayOnlyOnce=True
     bCanBeCanceled=True
     m_bIsTrainer=True
}


class file time: 12/7/2003 3:58:24 PM - creation time: 12/7/2003 4:03:39 PM
Created with UnCodeX